<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('AdminLogs/index')}">后台操作日志</a></li>
        <li><a href="{:url('AdminLogs/taskLog')}">计划任务日志</a></li>
        <li class="active"><a href="{:url('AdminLogs/runtime')}">后台缓存监控</a></li>
    </ul>
    <table class="table table-hover table-bordered margin-top-20">
        <thead>
        <tr>
            <td>文件列表</td>
            <td>文件大小</td>
            <td>更新时间</td>
            <td align="center" width="10%">操作</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td colspan="4"><b>当前目录上层键值：{$dir}</b></td>
        </tr>
        <php>
            $baseDir = basename($dir);
            $dir = str_replace('/', '-', $dir);
            $upDir = str_replace(array('-'.$baseDir, $baseDir), '', $dir);
        </php>
        <if condition="$baseDir">
            <tr>
                <td align="left" colspan="4">
                    <a href="{:url('runtime',array('dir' => $upDir))}"><img src="__STATIC__/images/folder-closed.gif"/>上一层目录</a>
                </td>
            </tr>
        </if>

        <foreach name="data" item="vo">
            <php>
                if(is_dir($path."/".$vo)){
                    $type = "dir";
                }else{
                    $type = "log";
                }
            </php>
            <tr>
                <td align="left">
                    <img src="__STATIC__/images/ext/{$type}.gif"/>
                    <if condition="$type == 'dir'">
                        <if condition="$dir">
                            <a href="{:url('runtime',array('dir' => $dir.'-'.$vo))}">{$vo}</a>
                        <else/>
                            <a href="{:url('runtime',array('dir' => $vo))}">{$vo}</a>
                        </if>
                    <else/>
                        <a href="{:url('runtimeLook', array('dir' => $dir, 'file' => $vo))}">{$vo}</a>
                    </if>
                </td>
                <td>
                    <if condition="file_exists_case($path.'/'.$vo)">
                        {:round(filesize($path.'/'.$vo) / 1024, 2)}k
                    </if>
                </td>
                <td>
                    <if condition="file_exists_case($path.'/'.$vo)">
                        {:date("H:i:s", filemtime($path.'/'.$vo))}
                    </if>
                </td>
                <td align="center">
                    <if condition="$type == 'log'">
                        <a class="btn btn-xs btn-primary" href="{:url('downloadRuntimeFile',array('dir' => $dir, 'file' => $vo))}">下载</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('deleteRuntimeFile',array('dir' => $dir, 'file' => $vo))}">删除</a>
                        <else/>
                        --
                    </if>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
</div>
<include file="public@footer" />